home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / os2 / mlrxshl.zip / CDIR.CMD next >
OS/2 REXX Batch file  |  1995-02-09  |  429b  |  20 lines

  1. /* cdir.cmd - a coloring dir filter */
  2.  
  3. signal on halt
  4.  
  5. do while lines()
  6.    handled = 1
  7.    l = linein()
  8.    select
  9.       when pos('<DIR>',l) > 0 then call charout ,'1b'x'[32m'
  10.       when WORDPOS(TRANSLATE(RIGHT(L,4)),'.EXE .CMD .BAT .COM') > 0  then call charout ,'1b'x'[36m'
  11.    otherwise
  12.       handled = 0
  13.    end  /* select */
  14.    say l 
  15.    if handled then call charout ,'1b'x'[0m'
  16. end /* do */
  17.  
  18. halt:
  19.    exit
  20.